<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
class2 = function() {
    // private fields
   var m_first = 1;
    var m_second = 2;
   // private methods
    function method1() {
        alert(m_first);
   }
    var method2 = function() {
        alert(m_second);
   }
    // public fields
    this.first = "first";
    this.second = ['s','e','c','o','n','d'];

    // public methods
    this.method1 = method2;
 
    this.method2 = function() {
        alert(this.second);
    }

   // constructor
    {
        method1();
       method2();
    }
}
// public method
class2.prototype.method3 = function() {
   alert(this.first);
}
 
var o = new class2();
 
o.method1();
o.method2();
o.method3();
alert(o.first);
//alert(class2.first)
</script>
</head>
<body>
<ul id="abc">
    <li>AAA</li>
    <li>BBB</li>
    <li>CCC</li>
</ul>
</body>
</html> 

